package day4.homework;

public class Rectangle {
    private double width;
    private double height;

    // 无参——宽、高默认值为1
    public Rectangle() {
        width = 1;
        height = 1;
    }

    public Rectangle(double width) {
        this.width = width;
        this.height = width;
    }

    public Rectangle(double width, double height) {
        this.width = width;
        this.height = height;
    }

    public double zhouChang() {
        return (width + height) * 2;
    }

    public double mianJi() {
        return width * height;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
}
